/*
 * @Author: dingxiao
 * @Date: 2025-06-25 15:54:49
 * @Description: 公共字段配置文件
 */

import { cleanHtml } from './utils';

/**
 * 表格只读组件配置，内容不折行显示
 */
export const TABLE_COLUMN_NO_WARP = {
  elType: 'input',
  attrs: {
    showOverflowTooltip: true,
  },
};

/**
 * 主办部门群组选择表单配置
 */
export const DEPT_GROUP_SELECT_CONFIG = {
  formElCode: 'departmentName',
  formElName: '主办部门',
  editable: '1',
  elType: 'personOrOrg', // 表单元素类型为 org
  visibleField: 'groupOrgTreeVisible',
  treeAttrs: {
    multiple: false,
    groupCode: 'DY_HOT_DEPT',
    removeTreeRootNode: true,
    identityId: sessionStorage.getItem('identityId'),
  },
};

/**
 * 以html展示调研类型
 */
export const htmlNormativeType = (h, showValue) => h('div', {
  domProps: {
    innerHTML: cleanHtml(showValue),
  },
  style: {
    display: 'inline-block',
    width: '100%',
  },
});
